<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 86135
  Date: 2022/5/9
  Time: 8:36
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" %>
<html>
<head>
    <title>用户信息</title>
    <script src="${pageContext.request.contextPath}/static/js/jquery-3.5.1.min.js"></script>
    <title>Title</title>
    <!-- 新 Bootstrap 核心 CSS 文件 -->
    <link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<div class="all-classes-container">
    <div class="row ui-helper-clearfix">
        <div class="col-md-12 column">
            <div class="page-header">
                <h1>
                    <small>用户信息</small>
                </h1>
            </div>
        </div>
        <div class="row">
            <div class="col-md-4 column">
                <a class="btn btn-primary" style="margin-left: 20px"
                   href="${pageContext.request.contextPath}/admin/touser">显示用户信息</a>
            </div>
            <div class="col-md-4 column">
                <form class="form-inline" action="${pageContext.request.contextPath}/admin/searchUser" method="post"
                      style="float: right"
                      autocomplete="off">
                    <label>
                        <input type="text" class="form-control" name="userName" required autocomplete="off"
                               placeholder="请输入要查询的用户名"/>
                    </label>
                    <input type="submit" value="查询" class="btn btn-primary"/>
                </form>
            </div>
            <div class="col-md-4 column">
                <%--                <a class="btn btn-primary" href="${pageContext.request.contextPath}/touserAction">回到主页面</a>--%>
            </div>
        </div>
    </div>
</div>
<div class="row ui-helper-clearfix">
    <div class="col-md-12 column">
        <table class="table table-hover table-striped">
            <thead>
            <tr>
                <th>用户名</th>
                <th>用户密码</th>
                <th>用户邮箱</th>
                <th>用户住址</th>
                <th>用户电话</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <c:forEach var="user" items="${users}">
                <tr>
                    <td>${user.userName}</td>
                    <td>${user.userPassword}</td>
                    <td>${user.userEmail}</td>
                    <td>${user.userAddress}</td>
                    <td>${user.userTelephonenumber}</td>
                    <td><a class="btn btn-warning"
                           href="${pageContext.request.contextPath}/admin/deleteUser/${user.userName}">删除</a>
                    </td>
                    <td>
                        <a class="btn btn-warning"
                           href="${pageContext.request.contextPath}/admin/updateUser/${user.userName}">修改</a>
                    </td>
                </tr>
            </c:forEach>
            <c:if test="${str!=null}">
                <script>
                    alert("${str}");
                </script>
            </c:if>
            </tbody>
        </table>
    </div>
</div>
</body>
</html>
